﻿using YNTK.Common.Const;
using YNTK.Common.Entity;
using SqlSugar;

namespace YNTK.Message.Entitys
{
    /// <summary>
    /// 消息实例
    /// 版 本：V1.0.0
    /// 版 权：云南通科科技有限公司（https://www.yntkkj.com）
    /// 作 者：李仕鹏
    /// 日 期：2022-10-23 
    /// </summary>
    [SugarTable("base_message")]
    [Tenant(ClaimConst.TENANT_ID)]
    public class MessageEntity : CLDEntityBase
    {
        /// <summary>
        /// 所属组织id
        /// </summary>
        [SugarColumn(ColumnName = "F_OrganizeId", ColumnDescription = "所属组织id", ColumnDataType = "nvarchar(50)")]
        public string OrganizeId { get; set; }

        /// <summary>
        /// 所属机构id
        /// </summary>
        [SugarColumn(ColumnName = "F_MechanismId", ColumnDescription = "所属机构id", ColumnDataType = "nvarchar(50)")]
        public string MechanismId { get; set; }

        /// <summary>
        /// 消息类型(0.平台公告 1.通知公告 2.系统消息 3.私信消息)
        /// </summary>
        [SugarColumn(ColumnName = "F_Type", ColumnDescription= "消息类型(0.平台公告 1.通知公告 2.系统消息 3.私信消息)")]
        public int? Type { get; set; }

        /// <summary>
        /// 通知公告接收对象类型(0.所有人 1.本机构 2.指定人员 3.特定机构)
        /// </summary>
        [SugarColumn(ColumnName = "F_Notice", ColumnDescription = "通知公告类型(0.所有人 1.本机构 2.指定人员 3.特定机构)")]
        public int? Notice { get; set; }

        /// <summary>
        /// 标题
        /// </summary>
        [SugarColumn(ColumnName = "F_Title", ColumnDescription= "标题")]
        public string Title { get; set; }

        /// <summary>
        /// 正文
        /// </summary>
        [SugarColumn(ColumnName = "F_BodyText", ColumnDescription= "正文")]
        public string BodyText { get; set; }

        /// <summary>
        /// 消息优先级
        /// 可以将消息的优先级设置为数字值,或让消息采用队列的缺省优先级
        /// </summary>
        [SugarColumn(ColumnName = "F_PriorityLevel", ColumnDescription= "消息优先级")]
        public int? PriorityLevel { get; set; }

        /// <summary>
        /// 收件用户id,多个用户按逗号分割
        /// </summary>
        [SugarColumn(ColumnName = "F_ToUserIds", ColumnDescription= "收件用户id,多个用户按逗号分割")]
        public string ToUserIds { get; set; }

        /// <summary>
        /// 收件机构id,多个机构按逗号分割
        /// </summary>
        [SugarColumn(ColumnName = "F_ToMechanismValue", ColumnDescription = "收件机构id,多个机构按逗号分割")]
        public string ToMechanismValue { get; set; }

        /// <summary>
        /// 是否阅读
        /// </summary>
        [SugarColumn(ColumnName = "F_IsRead", ColumnDescription = "是否阅读", ColumnDataType = "bit")]
        public bool IsRead { get; set; }

        /// <summary>
        /// 描述
        /// </summary>
        [SugarColumn(ColumnName = "F_Description", ColumnDescription= "描述")]
        public string Description { get; set; }

        /// <summary>
        /// 排序码
        /// </summary>
        [SugarColumn(ColumnName = "F_SORTCODE", ColumnDescription= "排序码")]
        public long? SortCode { get; set; }

        /// <summary>
        /// 阅读次数
        /// </summary>
        [SugarColumn(ColumnName = "F_READCOUNT")]
        public int? ReadCount { get; set; }

        /// <summary>
        /// 收件用户数量
        /// </summary>
        [SugarColumn(ColumnName = "F_ToUserCount")]
        public int? ToUserCount { get; set; }

        /// <summary>
        /// 已阅读用户数量
        /// </summary>
        [SugarColumn(ColumnName = "F_ReadUserCount")]
        public int? ReadUserCount { get; set; }
    }

}
